package cn.tedu.login.controller;

import cn.tedu.base.response.JsonResult;
import cn.tedu.login.pojo.dto.LoginParam;
import cn.tedu.login.pojo.entity.Login;
import cn.tedu.login.pojo.vo.LoginVO;
import cn.tedu.login.service.LoginService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@RequestMapping("/v1/user")
public class LoginController {

    @Autowired
    private LoginService loginService;


    @PostMapping("login")
    public JsonResult login(@RequestBody LoginParam loginParam) {
        log.debug("登陆参数第一次传到这里：{}", loginParam);
        LoginVO loginVO = loginService.login(loginParam);
        log.debug("登陆参数的返回处{}",loginVO);
        return JsonResult.ok(loginVO);

    }


}
